package com.jcw.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jcw.common.R;
import com.jcw.domain.Orders;
import com.jcw.service.OrdersService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrdersService ordersService;

    @GetMapping("/userPage")
    public R<Page> pageR(Integer page,Integer pageSize){
        return ordersService.pagination(page,pageSize);
    }

    @PostMapping("/submit")
    public R<String> submit(@RequestBody Orders orders){
        return ordersService.submit(orders);
    }
}
